<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/views/init.jsp"%>


<table id="grid"></table>
<div id="pager"></div>



<script type="text/javascript">
    jQuery("#grid").jqGrid({
        url:"<spring:url value="/pricing/cargo-price/table/json"/>",
        datatype: "json",
        colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
        colModel:[
            {name:'id',index:'id', width:55},
            {name:'invdate',index:'invdate', width:90, editable:true},
            {name:'name',index:'name', width:100,editable:true},
            {name:'amount',index:'amount', width:80, align:"right",editable:true},
            {name:'tax',index:'tax', width:80, align:"right",editable:true},
            {name:'total',index:'total', width:80,align:"right",editable:true},
            {name:'note',index:'note', width:150, sortable:false,editable:true}
        ],
        rowNum:10,
        rowList:[10,20,30],
        pager: "#pager",
        sortname: "id",
        viewrecords: true,
        sortorder: "desc",
        editurl: "<spring:url value="/table/json"/>",
        caption: "Using navigator",
        cellEdit: true,
        cellsubmit : "remote",
        cellurl : "<spring:url value="/table/json"/>",
        loadComplete: function(){
            alert("load complete");
        },
        gridComplete: function(){
            alert("grid complete");
        },
        afterInsertRow: function(){
            alert("after insert row");
        },
        afterEditCell: function(){
            alert("after edit cell");
        },
        afterRestoreCell: function(){
            alert("after restore cell");
        },
        afterSaveCell: function(){
            alert("after save cell");
        }
    });
    jQuery("#grid").jqGrid('navGrid',"#pager",{edit:false,add:false,del:false});
    jQuery("#grid").jqGrid('inlineNav',"#pager");

</script>
<%--
<script type="text/javascript">


  $(function() {
      $( "input[type=submit], a, button" )
              .button()
              .click(function( event ) {
                  event.preventDefault();
              });
  });
</script>

<div>
    <button>A button element</button>
    <input type="submit" value="A submit button" />
    <a href="#">An anchor</a>
</div>
--%>



